package com.iqiyi.pps.epg.api.server.impl;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.iqiyi.mams.hedvig.rpc.client.ServiceHelper;
import com.iqiyi.pps.epg.api.model.web.broadcast.TPlatformControl;
import com.iqiyi.pps.epg.api.server.iservice.BroadcastApiService;
import com.iqiyi.pps.epg.api.server.proxy.BroadcastProxy;
import com.iqiyi.pps.epg.api.server.web.broadcast.BroadcastControlWebService;
import com.iqiyi.pps.epg.api.utils.Constants;
import com.iqiyi.pps.epg.api.utils.CrossDataLocalPool;
import com.iqiyi.pps.epg.api.utils.ServiceUtil;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by karkarrotxu on 2017/4/17.
 */
@Service("broadcastApiServiceImpl")
public class BroadcastApiServiceImpl extends ApiServiceImpl implements BroadcastApiService {

    @Autowired
    private BroadcastProxy broadcastProxy;

    @Override
    public String getBroadcastControl( long channelId) {
        CrossDataLocalPool.set(getCrossData());
        return broadcastProxy.getBroadcastControl(channelId);
    }

    @Override
    public String setBroadcastControl( long channelId,
                                      String params,
                                      String assignToPrograms
    ) {
        CrossDataLocalPool.set(getCrossData());
        return broadcastProxy.setBroadcastControl(channelId,params,assignToPrograms);

    }

    @Override
    public String setBroadcastControlAll( long channelId,
                                         String platforms,
                                         String params,
                                        String assignToPrograms
    ) {
        CrossDataLocalPool.set(getCrossData());
        return broadcastProxy.setBroadcastControlAll(channelId, platforms, params, assignToPrograms);

    }
}
